<!DOCTYPE HTML><html>
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><? echo $title ?></title>
<? require("lib.php"); ?>
</head>
<body>
  <div class="content-box"><!-- Start Content Box -->
  <div class="content-box-header">
      <h3><? echo $title ?></h3><div class="clear"></div>
  </div><!-- End .content-box-header -->
  <div class="content-box-content">
<?
switch ($do) {
	case "add":add();break;
	case "update":update($rows);break;
	case "delete":delete($uid);break;
	default: show_info($rows);
}
?>
<? function show_box($rows, $iseditmode){
	global $option, $h, $title, $url;
	if($iseditmode){
?>
	<table width="99%" cellspacing="0" cellpadding="3" class="mbox">
		<tr class="th"><td class="thtitle" width="180" align="right"><? echo $title ?></td><td></td></tr>
		<?
		$str='';
		foreach($rows as $row){
			if(is_enabled($row['name']))$str.='<tr>';
			else $str.='<tr class="hide">';
			$str.='<td class="l">'.$row['tip_sc'].'</td><td>';
			$str.=$h->textarea('id_'.$row['id'], d($row['value']),'24','4','g');
			$str.='</td></tr>';
		}
		echo $str;
		?>
		<tr><td class="l">&nbsp;</td><td><br><input <? if(!$iseditmode)echo "class='hide'";?> type="submit" value="&nbsp; <?=ROOT_SAVE?> &nbsp;"> &nbsp; <a onClick="history.go(-1)">[ <?=ROOT_CANCEL?> ]</a><br><br></td></tr>
		<tr><td class="l">&nbsp;</td><td>&nbsp;</td></tr>
    </table>
    <p class="red"> * <?=ROOT_HOT_KEYWORD_TIP?></p>
    <?  }
    else {
      	$str='';
      	foreach($rows as $row){
			if(is_enabled($row['name']))$str.='<tr>';
			else $str.='<tr class="hide">';
      		$str.='<td class="l">'.$row['tip_sc'].'</td><td>'.d($row['value']).'</td></tr>';
      	}
    	?>
	<table width="99%" cellspacing="0" cellpadding="3" class="mbox set">
      <tr class="th"><td class="thtitle"  width="180" align="right"><? echo $title ?></td><td align="right"><input value="<?php echo decode($row["id"]) ?>" name="id" type="hidden"></td></tr>
      <? echo $str; ?>
      <tr><td class="l">&nbsp;</td><td><br><a href="<? echo $url ?>.php?do=update">[ <?=ROOT_EDIT_SETTING?> ]</a><br><br></td></tr>
    </table>
	<?
}
	} ?>
 <br class="clear" />
	</div> <!-- End .content-box-content -->
    <br class="clear" />
</div><!-- End .content-box -->
</body>
</html>